@...LABEL / DEFINE
LABEL
Creates
a label control
Standard Syntax (xBase Style):
@ <nRow> ,<nCol>
LABEL<ControlName>
[ OF | PARENT <ParentWindowName> ]
VALUE <cValue>
[ ACTION | ONCLICK |
ON CLICK <ActionProcedureName> | <bBlock> ]
[ WIDTH <nWidth> ]
[ HEIGHT <nHeight> ]
[ AUTOSIZE ]
[ FONT <cFontname> SIZE <nFontsize> ]
[ BOLD ] [ ITALIC ] [ UNDERLINE ] [ STRIKEOUT ]
[ TOOLTIP <cToolTipText> ]
[ BACKCOLOR <anBackColor> ]
[ FONTCOLOR <anFontColor>]
[ TRANSPARENT ]
[ RIGHTALIGN | CENTERALIGN ]
[ HELPID <nHelpId> ]
[ INVISIBLE ]
[ ENDELLIPSES ]
[ NOPREFIX ]
Alternate Syntax:
DEFINE LABEL
PARENT <ParentWindowName>
ROW <nValue>
VALUE <cValue>
ONCLICK <ActionProcedureName>
WIDTH <nWidth>
HEIGHT <nHeight>
AUTOSIZE <lValue>
FONTNAME <cValue>
FONTSIZE <nValue>
FONTBOLD <lValue>
FONTITALIC <lValue>
FONTUNDERLINE <lValue>
FONTSTRIKEOUT <lValue>
TOOLTIP <cToolTipText>
BACKCOLOR <anBackColor>
FONTCOLOR <anFontColor>
TRANSPARENT <lValue>
ALIGNMENT Left | Right | Center
HELPID <nHelpId>
VISIBLE <lValue>
ENDELLIPSES <lValue>
NOPREFIX <lValue>
END LABEL
Properties:
- Value
- Enabled
- Visible
- Row
- Col
- Width
- Height
- FontName
- FontSize
- FontBold
- AutoSize
- Name (R)
- Parent (D)
- HelpId (D)
- Alignment (D)
- EndEllipses (D)
- NoPrefix (D)
D: Available at control definition only
R: Read-Only
Events:
- OnClick
Methods:
- Show
- Hide
- Release
Note:
ENDELLIPSES
--> If the string does not fit in the size of the Label control, the string
is truncated and ellipses (...) are added.
NOPREFIX
--> Prevents interpretation of any ampersand (&) characters in the
control's text as accelerator prefix characters. These are displayed with the
ampersand removed and the next character in the string underlined.
Example:
#include "hmg.ch"
Function
DEFINE WINDOW Form_Main ;
AT 0,0 ;
WIDTH 640 HEIGHT 480 ;
TITLE 'Main Window' ;
@ 200,250 LABEL Label_1 ;
WIDTH 150 HEIGHT 40 ;
VALUE 'Click Me !' ;
ACTION MsgInfo('Label
Clicked!!!') ;
FONT 'Arial' SIZE 24 CENTERALIGN
@ 10,10 LABEL Label_2 ;
AUTOSIZE ;
VALUE '...' ;
ACTION msginfo('test')
END WINDOW
Form_Main.Label_2.Value := 'Hello All,
This Is An AutoSizable Label display!!!'
CENTER WINDOW Form_Main
ACTIVATE WINDOW Form_Main
Return Nil
Other Examples: (Create at forum site a
folder “SAMPLES”)
http://www.hmgforum.com/SAMPLES/Controls/Label/LABEL_1 (Open new
window with source preview)
http://www.hmgforum.com/SAMPLES/Controls/Label/LABEL_2 (Open new
window with source preview)